home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD008b.dsk
/
STOPWATCH.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
4KB
|
138 lines
5 GOSUB 20000
10 DLY = 14
15 LDLY = 1.5
20 TEXT : HOME
100 POKE 33,25
105 POKE 32,15
110 HOME
112 A = 0
115 TA = 1
120 H = 0:M = 0:S = 0:D = 0:Y = 0
130 GOSUB 1000: REM PLOT TIME
200 REM MAIN LOOP
210 GOSUB 10000
220 GOSUB 3000
230 GOSUB 1000
240 IF S +M +H +D +Y = 0 AND A < >0 THEN 4000
250 GOTO 200
1000 REM PLOT TIME
1005 VTAB 2
1010 PRINT "YEARS= ";Y;" "
1015 PRINT
1020 PRINT "DAYS= ";D;" "
1025 PRINT
1030 PRINT "HOURS= ";H;" "
1035 PRINT
1040 PRINT "MINUTES= ";M;" "
1045 PRINT
1050 PRINT "SECONDS= ";S;" "
1090 RETURN
2000 REM INPUT?
2010 I = PEEK( -16384)
2020 POKE -16368,0
2030 IF I = 149 THEN GOSUB 2100: REM +
2040 IF I = 136 THEN GOSUB 2200: REM -
2045 IF I = 204 THEN GOSUB 2400
2050 IF I = 141 THEN GOSUB 2300
2060 IF I = 160 THEN GOSUB 8000
2070 IF I = 155 THEN 9000
2075 IF I < >211 AND I < >176 THEN RETURN
2080 IF I = 211 THEN GOSUB 7000
2085 IF I = 176 THEN RUN 10
2090 RETURN
2100 IF A < >1 THEN LOOP = DLY -LOOP
2110 A = 1
2112 VTAB 12: HTAB 3
2115 PRINT "-->"
2120 RETURN
2200 IF A < > -1 THEN LOOP = DLY -LOOP
2210 A = -1
2215 VTAB 12: HTAB 3
2220 PRINT "<--"
2230 RETURN
2300 REM STOP COLD
2310 A = 0
2320 VTAB 12: HTAB 3
2325 PRINT " "
2330 RETURN
2400 REM
2410 LOOP = LOOP +LDLY
2420 VTAB 15: HTAB 2: PRINT "LAP TIMES:"
2422 H$ = STR$(H): IF H <10 THEN H$ = "0" +H$
2424 M$ = STR$(M): IF M <10 THEN M$ = "0" +M$
2426 S$ = STR$(S): IF S <10 THEN S$ = "0" +S$
2428 VTAB 17 +NL:NL = NL +1: IF NL >6 THEN NL = 0
2430 PRINT Y","D" "H$":"M$":"S$;: CALL -868: PRINT
2450 RETURN
3000 REM ADVANCE TIME
3005 IF PAUSE = 1 THEN RETURN
3010 S = S +A: IF S > = 0 AND S <60 THEN RETURN
3015 S = S -60
3017 IF S <0 THEN S = 59
3020 M = M +A: IF M > = 0 AND M <60 THEN RETURN
3025 M = M -60
3027 IF M <0 THEN M = 59
3030 H = H +A: IF H > = 0 AND H <24 THEN RETURN
3035 H = H -24
3037 IF H <0 THEN H = 23
3040 D = D +A: IF D > = 0 AND D <365 THEN RETURN
3050 D = D -365: IF D <0 THEN D = 364
3060 Y = Y +A
3062 IF A = 0 THEN RETURN
3070 RETURN
4000 FOR COUNT = 1 TO 15
4005 PRINT "<CTRL-G>";
4010 IF PEEK( -16384) <128 THEN NEXT COUNT
4020 POKE -16368,0
4030 RUN 10
7000 REM SET
7010 CALL -936: VTAB 2
7015 INPUT "YEARS= ";Y
7020 PRINT
7030 INPUT "DAYS= ";D
7035 PRINT
7040 INPUT "HOURS= ";H
7045 PRINT
7050 INPUT "MINUTES= ";M
7055 PRINT
7060 INPUT "SECONDS= ";S
7063 CALL -936: GOSUB 1000
7065 LOOP = 1
7067 A = 0:PAUSE = 0
7068 NL = 0
7070 RETURN
8000 REM PAUSE
8010 IF PAUSE = 0 THEN 8100
8030 VTAB 13: HTAB 4
8040 PRINT " "
8050 PAUSE = 0
8060 RETURN
8100 REM SET PAUSE:
8120 VTAB 13: HTAB 4
8130 PRINT "P"
8140 PAUSE = 1
8150 RETURN
9000 TEXT : CALL -936: END
10000 REM TIME LOOP
10010 FOR LOOP = 1 TO DLY
10011 A = A
10012 QQ = 1
10014 A = A:A = A
10015 GOSUB 2000
10020 NEXT LOOP
10999 RETURN
20000 REM
20010 HOME : PRINT : PRINT "****************************************STOPWATCH - BY DANIEL TOBIAS - MAY, 1982";
20015 PRINT "****************************************"
20020 PRINT "COMMANDS:": PRINT : PRINT "RIGHT ARROW: FORWARD"
20030 PRINT "LEFT ARROW: REVERSE"
20040 PRINT "RETURN KEY: STOP"
20050 PRINT "SPACE BAR: PAUSE; HIT AGAIN TO CONTINUE"
20060 PRINT "0: RESET TO ZERO; STOP"
20070 PRINT "S: SET TIME"
20080 PRINT "L: POST LAP TIME (UP TO 7 LAP TIMES MAY BE DISPLAYED AT ONCE)"
20085 PRINT "ESC: QUIT"
20090 PRINT : PRINT "YOU CAN TINKER WITH THE ACCURACY OF THE STOPWATCH BY CHANGING THE VARIABLE"
20100 PRINT "DLY IN LINE 10, OR BY ADDING OR REMOVINGDUMMY STATEMENTS SUCH AS 'A=A' IN THE"
20110 PRINT "DELAY LOOP (LINES 10000 THRU 10120)."
20120 PRINT : PRINT "HIT ANY KEY TO START. ";: GET I$: PRINT : RETURN